﻿// =====================================================================
// <copyright file="EnumerableExtensions.cs" author="David R. Guindo">
// 	Copyright (C) 2013. All rights reserved.
// </copyright>
// =====================================================================
// This code is released under the terms of the Apache 2.0 license, 
// http://apache.org/licenses/LICENSE-2.0.html
// =====================================================================

namespace System.Collections
{
    using System.Linq;

    public static class EnumerableExtensions
    {
        public static int Count(this IEnumerable source)
        {
            if (source == null) return 0;
            return Enumerable.Count(source.Cast<object>());
        }

        public static long LongCount(this IEnumerable source)
        {
            if (source == null) return 0;
            return Enumerable.Count(source.Cast<object>());
        }
    }
}